﻿using System;
using UnityEngine;
using UnityEngine.UI;
using Jinndev.Modding;
using Jinndev.ModEditor;

namespace Jinndev.Tile2D {

    [SubConfigBlockEditor(typeof(RenderConfig))]
    internal class RenderConfigBlockEditor : AbstractSubConfigBlockEditor {

        public RenderConfig RenderConfig { get; private set; }

        private StringField textureField;
        private StringField materialField;

        protected override void OnInit() {
            RenderConfig = SubConfig as RenderConfig;
            textureField = CreateStringField("Texture", RenderConfig.texture);
            materialField = CreateStringField("Material", RenderConfig.material);
            // TODO
        }

        public override void OnSave() {
            RenderConfig.texture = textureField.Value;
            RenderConfig.material = materialField.Value;
        }

    }

}
